﻿using BlazorApp3.Client.Infrastructure.Services;
using Blazored.LocalStorage;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;

namespace BlazorApp3.Client.Infrastructure;

public static class DependencyInjectionExtension
{
    public static IServiceCollection AddInfrastructureServices(
        this IServiceCollection services,
        IConfiguration config)
    {
        services.AddBlazoredLocalStorageAsSingleton();
        services.AddSingleton<ICounterRepository, CounterRepository>();

        services.AddHttpClient<IWeatherforecaseService, WeatherforecaseClientService>();

        return services;
    }
}